package com.nuanshui.heatedloan.order.integration.bean;

import com.nuanshui.heatedloan.dubbo.DubboResponse;
import com.nuanshui.heatedloan.msgcenter.model.AliSmsNotificationCodeTemp;
import com.nuanshui.heatedloan.task.facade.constant.TaskEnum;

import java.util.Date;

/**
 * 订单执行的result 信息
 * @Author: Gonzo
 * @Date 2017/4/18下午3:09
 * @since 1.4.2
 */
public class OrderResult {
    private int code = 200;
    private String msg  = "";
    private String data ;

    //短信发送的参数
    private String pushBizId;
    private String pushBizType;
    private AliSmsNotificationCodeTemp  smsPushCodeTemp;

    //定时推送的参数
    private Date orderExpireTime;
    private TaskEnum taskType;

    public Date getOrderExpireTime() {
        return orderExpireTime;
    }

    public void setOrderExpireTime(Date orderExpireTime) {
        this.orderExpireTime = orderExpireTime;
    }

    public TaskEnum getTaskType() {
        return taskType;
    }

    public void setTaskType(TaskEnum taskType) {
        this.taskType = taskType;
    }

    public AliSmsNotificationCodeTemp getSmsPushCodeTemp() {
        return smsPushCodeTemp;
    }

    public void setSmsPushCodeTemp(AliSmsNotificationCodeTemp smsPushCodeTemp) {
        this.smsPushCodeTemp = smsPushCodeTemp;
    }

    public String getPushBizId() {
        return pushBizId;
    }

    public void setPushBizId(String pushBizId) {
        this.pushBizId = pushBizId;
    }

    public String getPushBizType() {
        return pushBizType;
    }

    public void setPushBizType(String pushBizType) {
        this.pushBizType = pushBizType;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public void setMsg(String msg, int code) {
        this.msg = msg;
        this.code = code;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    public boolean isSuccess() {
        return code == 200;
    }

    public DubboResponse getDubboResponse(){
        DubboResponse resp = new DubboResponse();
        resp.setMsg(this.msg);
        resp.setCode(this.code);
        resp.setData(this.data);
        return resp;
    }
}
